UriResolver = {
    resourcepath : function(filepath){
		var nspath = this.namespace.replace(/\./g,"/") + "/";
		if (filepath.indexOf("/") === 0 || filepath.indexOf("http://") === 0) {
			return filepath;
		}
		else {
			if (window.config.loadpaths.CDN && !(filepath.indexOf("http://") === 0)) {
				return window.config.loadpaths.CDN + nspath + filepath;
			}
			else {
				return config.loadpaths.LIBROOT + nspath + filepath;
			}
		}
    },
    
    cdn : function(){
        var cdns      = config.cdn.enabled;
		var hostindex = Math.round(Math.random()*cdns.length-1);
			hostindex = (hostindex < 0) ? 0:hostindex;
        var cdn    = cdns[hostindex];
		return cdn.protocol + cdn.host + config.loadpaths.LIBROOT;
	}
};
